/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.fsiebert.polytech.db.mediatheque.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Florent
 */
@Embeddable
public class LigneDeCommandePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ItemRef", nullable = false)
    private int itemRef;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idCommande", nullable = false)
    private int idCommande;

    public LigneDeCommandePK() {
    }

    public LigneDeCommandePK(int itemRef, int idCommande) {
        this.itemRef = itemRef;
        this.idCommande = idCommande;
    }

    public int getItemRef() {
        return itemRef;
    }

    public void setItemRef(int itemRef) {
        this.itemRef = itemRef;
    }

    public int getIdCommande() {
        return idCommande;
    }

    public void setIdCommande(int idCommande) {
        this.idCommande = idCommande;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) itemRef;
        hash += (int) idCommande;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LigneDeCommandePK)) {
            return false;
        }
        LigneDeCommandePK other = (LigneDeCommandePK) object;
        if (this.itemRef != other.itemRef) {
            return false;
        }
        if (this.idCommande != other.idCommande) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "eu.fsiebert.polytech.db.mediatheque.entity.LigneDeCommandePK[ itemRef=" + itemRef + ", idCommande=" + idCommande + " ]";
    }
    
}
